package com.yqyd.web.controller.nbot.web;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.yqyd.common.core.domain.R;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.yqyd.common.annotation.Log;
import com.yqyd.common.core.controller.BaseController;
import com.yqyd.common.core.domain.AjaxResult;
import com.yqyd.common.enums.BusinessType;
import com.yqyd.nbot.domain.NbotActivityRegistrations;
import com.yqyd.nbot.service.INbotActivityRegistrationsService;
import com.yqyd.common.utils.poi.ExcelUtil;
import com.yqyd.common.core.page.TableDataInfo;

/**
 * 九号 - 活动报名Controller
 * 
 * @author Dhq
 * @date 2025-09-01
 */
@RestController
@RequestMapping("/nbot/registrations")
public class NbotActivityRegistrationsController extends BaseController
{
    @Autowired
    private INbotActivityRegistrationsService nbotActivityRegistrationsService;

    /**
     * 查询九号 - 活动报名列表
     */
    @PreAuthorize("@ss.hasPermi('nbot:registrations:list')")
    @GetMapping("/list")
    public R<List<NbotActivityRegistrations>> list(NbotActivityRegistrations nbotActivityRegistrations)
    {
        return R.ok( nbotActivityRegistrationsService.selectNbotActivityRegistrationsList(nbotActivityRegistrations));
    }

    /**
     * 获取九号 - 活动报名详细信息
     */
    @PreAuthorize("@ss.hasPermi('nbot:registrations:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(nbotActivityRegistrationsService.selectNbotActivityRegistrationsById(id));
    }

    /**
     * 修改九号 - 活动报名
     */
    @PreAuthorize("@ss.hasPermi('nbot:registrations:edit')")
    @Log(title = "九号 - 活动报名", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody NbotActivityRegistrations nbotActivityRegistrations)
    {
        return toAjax(nbotActivityRegistrationsService.updateNbotActivityRegistrations(nbotActivityRegistrations));
    }

}
